/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ve.com.cantv.worktables.ejb.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Ghust
 */
@Entity
@Table(name = "category_activity")
@NamedQueries({@NamedQuery(name = "CategoryActivity.findAll", query = "SELECT c FROM CategoryActivity c"), @NamedQuery(name = "CategoryActivity.findByIdCategoryActivity", query = "SELECT c FROM CategoryActivity c WHERE c.idCategoryActivity = :idCategoryActivity"), @NamedQuery(name = "CategoryActivity.findByName", query = "SELECT c FROM CategoryActivity c WHERE c.name = :name"), @NamedQuery(name = "CategoryActivity.findByFriendlyName", query = "SELECT c FROM CategoryActivity c WHERE c.friendlyName = :friendlyName")})
public class CategoryActivity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_category_activity")
    private Integer idCategoryActivity;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Basic(optional = false)
    @Column(name = "friendly_name")
    private String friendlyName;
    @OneToMany(mappedBy = "idcategory")
    private Collection<Activity> activityCollection;

    public CategoryActivity() {
    }

    public CategoryActivity(Integer idCategoryActivity) {
        this.idCategoryActivity = idCategoryActivity;
    }

    public CategoryActivity(Integer idCategoryActivity, String name, String friendlyName) {
        this.idCategoryActivity = idCategoryActivity;
        this.name = name;
        this.friendlyName = friendlyName;
    }

    public Integer getIdCategoryActivity() {
        return idCategoryActivity;
    }

    public void setIdCategoryActivity(Integer idCategoryActivity) {
        this.idCategoryActivity = idCategoryActivity;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFriendlyName() {
        return friendlyName;
    }

    public void setFriendlyName(String friendlyName) {
        this.friendlyName = friendlyName;
    }

    public Collection<Activity> getActivityCollection() {
        return activityCollection;
    }

    public void setActivityCollection(Collection<Activity> activityCollection) {
        this.activityCollection = activityCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCategoryActivity != null ? idCategoryActivity.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CategoryActivity)) {
            return false;
        }
        CategoryActivity other = (CategoryActivity) object;
        if ((this.idCategoryActivity == null && other.idCategoryActivity != null) || (this.idCategoryActivity != null && !this.idCategoryActivity.equals(other.idCategoryActivity))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.com.cantv.worktables.ejb.entity.CategoryActivity[idCategoryActivity=" + idCategoryActivity + "]";
    }

}
